/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package thienphuc.patient.dao.common;

/**
 *
 * @author QuocDat
 */
public class CommonDAO {

    /**
     * Check input is null or empty
     * @param objectList Parameter list input
     * @return 
     */
    public static boolean checkInput(Object... objectList) {
        for (Object obj : objectList) {
            //Check obj is instanceof String
            if (obj instanceof String) {
                //Cast obj to String
                String str = (String) obj;
                //Check object is NULL or empty
                if (str == null || str.trim().length() == 0) {
                    return false;
                }
            }
            //Check obj is instanceof Integer
            if(obj instanceof Integer){
                //Cast obj to Integer
                int integer = (Integer)obj;
                //Check integer is less than or equal 0
                if(integer <= 0)
                    return false;
            }
        }
        return true;
    }
}
